<!DOCTYPE html>
<html lang="en">
  <head>
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
      <title>易买网</title>
      <link rel="stylesheet" type="text/css" href="./css/style.css">
      <script type="text/javascript" src="js/jquery-1.11.1.js"></script>
      <script type="text/javascript" src="js/My97DatePicker/WdatePicker.js"></script>
  </head>
  <body>
      <!--头部-->
      <div id="header" class="wrap">
          <!-- 导航栏信息 -->
          <div id="logo">
              <img src="./images/logo.gif">
          </div>
          <div class="help">
              <a href="javascript:checkLogin()" class="shopping">购物车</a>
              <a href="login.jsp">登录</a>
              <a href="register.jsp">注册</a>
              <a href="javascript:checkLogin()">留言板</a>
              <form action="productServlet" method="post">
                  <input type="text" name="product"><!-- autocomplete="off" -->
                  <input type="hidden" name="oper" value="search">
                  <input type="submit" value="搜索">
              </form>
          </div>

          <div class="navbar">
              <ul class="clearfix">
                  <li class="current"><a href="index">首页</a></li>

                  <li>
                      <a href="productServlet?oper=productType&id=1">服饰</a>
                  </li>

                  <li>
                      <a href="productServlet?oper=productType&id=2">数码</a>
                  </li>

                  <li>
                      <a href="productServlet?oper=productType&id=3">美食</a>
                  </li>

                  <li>
                      <a href="productServlet?oper=productType&id=4">家电</a>
                  </li>

              </ul>
          </div>

          <div id="childNav">
              <div class="wrap">
                  <ul class="clearfix">
                      <li class="first">
                          <a href="http://www.yjxxt.com/">音乐</a>
                      </li>
                      <li>
                          <a href="http://www.baidu.com/">影视</a>
                      </li>
                      <li>
                          <a href="index">少儿</a>
                      </li>
                      <li>
                          <a href="index">运动鞋</a>
                      </li>
                      <li>
                          <a href="index">美容护肤</a>
                      </li>
                      <li>
                          <a href="index">家纺用品</a>
                      </li>
                      <li>
                          <a href="index">婴幼奶粉</a>
                      </li>
                      <li class="last">
                          <a href="index">饰品</a>
                      </li>
                  </ul>
              </div>
          </div>

          <script type="text/javascript">
              function checkLogin() {
                  if ('' == '') {
                      alert("请先登录");
                  } else {
                      window.laction.href = "shopping?oper=list";
                  }
              }

              function logout() {
                  if (confirm('您确定要退出系统吗 ? ')) {
                      window.location.href = "userServlet?oper=logout";
                  }
              }
          </script>

      </div>


      <div id="main" class="wrap">
          <!--左侧分类-->
          <div class="lefter">
              <!-- 商品分类信息栏 -->
              <div class="box">
                  <h2>商品分类</h2>
                  <dl>
                      <dt>服饰</dt>
                      <dd>
                          <a href="productServlet?oper=smallType&id=6">连衣裙</a>
                      </dd>
                      <dd>
                          <a href="productServlet?oper=smallType&id=7">男士西装</a>
                      </dd>
                      <dd>
                          <a href="productServlet?oper=smallType&id=8">牛仔裤</a>
                      </dd>
                      <dt>数码</dt>
                      <dd>
                          <a href="productServlet?oper=smallType&id=9">相机</a>
                      </dd>
                      <dd>
                          <a href="productServlet?oper=smallType&id=29">音箱</a>
                      </dd>
                      <dd>
                          <a href="productServlet?oper=smallType&id=30">MP3/MP4</a>
                      </dd>
                      <dt>美食</dt>
                      <dd>
                          <a href="productServlet?oper=smallType&id=31">进口食品</a>
                      </dd>
                      <dd>
                          <a href="productServlet?oper=smallType&id=32">地方特产</a>
                      </dd>

                      <dd>
                          <a href="productServlet?oper=smallType&id=33">休闲食品</a>
                      </dd>


                      <dt>家电</dt>

                      <dd>
                          <a href="productServlet?oper=smallType&id=34">平板电视</a>
                      </dd>

                      <dd>
                          <a href="productServlet?oper=smallType&id=35">洗衣机</a>
                      </dd>

                      <dd>
                          <a href="productServlet?oper=smallType&id=36">冰箱</a>
                      </dd>


                  </dl>
              </div>

              <div class="last-view">
                  <h2>最近浏览</h2>
                  <dl class="clearfix">
                      <dt>
                          <a href="productServlet?oper=addCard&amp;productId=21"><img src="images/product/15.jpg" class="imgs" style="height: 50px;width: 50px;"></a>
                      </dt>
                      <dd>
                          <a href="productServlet?oper=addCard&amp;productId=21">货到付款Mr.TA 西服 </a>
                      </dd>
                  </dl>
                  <dl class="clearfix">
                      <dt>
                          <a href="productServlet?oper=addCard&amp;productId=21"><img src="images/product/15.jpg" class="imgs" style="height: 50px;width: 50px;"></a>
                      </dt>
                      <dd>
                          <a href="productServlet?oper=addCard&amp;productId=21">货到付款Mr.TA 西服 </a>
                      </dd>
                  </dl>
              </div>


          </div>
          <!-- 主要内容 -->
          <div class="main">
              <div id="register" class="main">
                  <!--注册框-->
                  <div class="shadow" style="float:left;width: 500px;margin: 0px 15px">
                      <em class="corner lb"></em>
                      <em class="corner rt"></em>
                      <div class="box">
                          <h1>欢迎注册易买网</h1>
                          <ul class="steps clearfix">
                              <li class="current"><em></em>填写注册信息</li>
                              <li class="last"><em></em>注册成功</li>
                          </ul>
                          <form id="regForm" method="post" action="user?oper=register" onsubmit="return checkForm()" style="padding: 0 0;">
                              <table>
                                  <tr>
                                      <td class="field">用户名(*)：</td>
                                      <td><input class="text" type="text" id="userName" name="userName" onblur="checkUserName()" />&nbsp;<font id="userErrorInfo" color="red"></font></td>
                                  </tr>
                                  <tr>
                                      <td class="field">登录密码(*)：</td>
                                      <td><input class="text"  type="password" id="password" name="password" /></td>
                                  </tr>
                                  <tr>
                                      <td class="field">确认密码(*)：</td>
                                      <td><input class="text" type="password"  id="rePassWord"  name="rePassWord"/></td>
                                  </tr>

                                  <tr>
                                      <td class="field">性别(*)：</td>
                                      <td>
                                          <input type="radio"   name="sex" value="男" checked="checked"/>男&nbsp;&nbsp;
                                          <input type ="radio" name="sex" value="女"/>女
                                      </td>
                                  </tr>
                                  <tr>
                                      <td class="field">出生日期：</td>
                                      <td>
                                          <input  type="text"  id="birthday"  name="birthday"  class="Wdate" onClick="WdatePicker()"/>
                                      </td>
                                  </tr>
                                  <tr>
                                      <td class="field">身份证号：</td>
                                      <td><input class="text" type="text" id="dentityCode" name="dentityCode"  /></td>
                                  </tr>
                                  <tr>
                                      <td class="field">Email：</td>
                                      <td><input class="text" type="text" id="email" name="email"  /></td>
                                  </tr>
                                  <tr>
                                      <td class="field">手机号码(*)：</td>
                                      <td><input class="text" type="text" id="mobile" name="mobile" /></td>
                                  </tr>
                                  <tr>
                                      <td class="field">收货地址(*)：</td>
                                      <td><input class="text" type="text" id="address" name="address" /></td>
                                  </tr>
                                  <tr>
                                      <td></td>
                                      <td><label class="ui-green"><input type="submit" name="submit" value="提交注册" /></label></td>
                                  </tr>
                                  <tr>
                                      <td>&nbsp;</td>
                                      <td><font id="error" color="red"></font></td>
                                  </tr>
                              </table>
                          </form>
                      </div>
                  </div>
                  <!--右侧公告和广告-->
                  <div class="side">
                      <!--公告列表-->
                      <div class="news-list">
                          <h4>最新公告</h4>
                          <ul>

                              <li><a href="noticeServlet?noticeId=1">公告一</a></li>

                              <li><a href="noticeServlet?noticeId=2">公告二</a></li>

                              <li><a href="noticeServlet?noticeId=3">公告三</a></li>

                              <li><a href="noticeServlet?noticeId=4">公告四</a></li>

                              <li><a href="noticeServlet?noticeId=5">公告五</a></li>

                              <li><a href="noticeServlet?noticeId=6">公告六</a></li>

                              <li><a href="noticeServlet?noticeId=7">公告七</a></li>

                          </ul>
                      </div>
                      <div class="spacer "></div>
                      <!--新闻列表-->
                      <div class="news-list">
                          <h4>新闻动态</h4>
                          <ul>

                              <li><a href="newsServlet?newsId=1">新闻一</a></li>

                              <li><a href="newsServlet?newsId=2">新闻二</a></li>

                              <li><a href="newsServlet?newsId=3">新闻三</a></li>

                              <li><a href="newsServlet?newsId=4">新闻四</a></li>

                              <li><a href="newsServlet?newsId=5">新闻五</a></li>

                              <li><a href="newsServlet?newsId=6">新闻六</a></li>

                              <li><a href="newsServlet?newsId=7">新闻七</a></li>

                          </ul>
                      </div>
                  </div>
                  <div class="spacer clear"></div>
              </div>
          </div>
          <div class="clear"></div>
      </div>
      <div id="footer">
          Copyright ©2019 XXX公司的 All rights reserved.
      </div>

  </body>
  <script type="text/javascript">

      function checkForm(){
          // var 变量  userName是变量名  ; 通过$获取ID，就相当与拿到了这个元素的value   { val() }
          var userName=$("#userName").val();
          var password=$("#password").val();
          var rePassWord=$("#rePassWord").val();
          var mobile=$("#mobile").val();
          var address=$("#address").val();
          if(userName==""){
              $("#error").html("用户名不能为空"); //向error指定的元素中添加一句话！
              return false;
          }
          if(password==""){
              $("#error").html("密码不能为空");
              return false;
          }
          if(rePassWord==""){
              $("#error").html("确认密码不能为空");
              return false;
          }
          if(rePassWord!=password){
              $("#error").html("密码要与确认密码相同");
              return false;
          }
          if(mobile==""){
              $("#error").html("手机号码不能为空");
              return false;
          }
          if(address==""){
              $("#error").html("地址不能为空");
              return false;
          }
          return true;
      }

      function checkUserName(){
          //获取你在该元素中写的值
          var userName=$("#userName").val();
          if(userName==""){
              //如果是空的，对不起用户不能空！
              $("#userErrorInfo").html("用户名不能为空 !");
              //鼠标仍然存在此输入框中
              $("#userName").focus();
              return;
          }else{
              //否者我的这个userErrorInfo 什么都不做！
              $("#userErrorInfo").html("");
          }

          // $.post("user?oper=checkName",{userName: userName}, function(data){
          //     if(data=='true') {
          //         $("#userErrorInfo").html("");
          //     }else{
          //         $("#userErrorInfo").html("用户名已存在，请重新输入！");
          //         $("#userName").focus();
          //     }
          // });
      }
  </script>
</html>